package com.idata.model.proxyDO;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.idata.model.utils.DefaultImgUrlManager;
import com.idata.model.utils.ImgReplaceUtils;
import lombok.Data;

import java.util.List;

@Data
public class KGGraphExploreDO {

    @JsonAlias("userName")
    @JsonProperty
    private String content;

    @JsonAlias("cardNo")
    @JsonProperty
    private String id;

    private String avatarUrl;

    private List<String> relationList;

    private String src;

    private String dst;

    private boolean hasDispute;

    public String getAvatarUrl() {
        if (StrUtil.isNotEmpty(avatarUrl)) {
            return ImgReplaceUtils.replaceHost(avatarUrl);
        }
        return DefaultImgUrlManager.DEFAULT_AVATAR_IMG_URL;
    }
}
